/*

 Copyright (C) 2009 Team16
This program is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version. This program is distributed in the
hope that it will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU General Public License
for more details. You should have received a copy of the GNU General
Public License along with this program. If not, see <http://www.gnu.org/licens

  */
#ifndef MAINWINDOW_H


#define MAINWINDOW_H

#include <QMainWindow>
#include <QtGui/QTabWidget>
#include "highlighter.h"
#include <QtWebKit>
#include <QLayout>
#include <QtGui/QLineEdit>
#include <QtGui/QPushButton>
#include <QDirModel>
#include <QTreeView>




QT_BEGIN_NAMESPACE
class QTextEdit;
QT_END_NAMESPACE
class PreviewForm;

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = 0);

public slots:
    void about();
    void newFile();
    void saveFile(const QString &path = QString());
    void openFile(const QString &path = QString());
    void openRec();
    void Setcurrent(const QString &path = QString());
    void updateRecentFileActions();
    void tabchanged(int tab);
    void gobutton();
    void treeclick(QModelIndex sd);
    void helpclick(QModelIndex sd);
private:

    void findCodecs();
    QList<QTextCodec *> codecs;
    PreviewForm *previewForm;

    void setupEditor();
    void setupFileMenu();
    void setupHelpMenu();

    QWidget *wnd;
    QAction *separatorAct;

    QAction *recents[5];
    QTabBar *tabs;

    QTextEdit *editor;
    Highlighter *highlighter;



    // layers for tabs
    QVBoxLayout *mainl;
    QVBoxLayout *web;
    QVBoxLayout *projectt;
    QHBoxLayout *help;


    // web tab
    QLineEdit *lineEdit;
    QWebView *wview;
    QPushButton *pushButton;


    // project tab

     QDirModel model;
     QTreeView *tree;
     QString projst;
     QString curFile;

     // help tab

     QDirModel helpmodel;
     QTreeView *helptree;
     QLineEdit *findedit;
     QPushButton *search;

     QVBoxLayout *sleft;
     QHBoxLayout *suleft;

     QWebView *hview;

     // stat tab
     QTextEdit *stat;
     QString lang;
};
//! [0]

#endif


